var SceneManager = function()
{
	this.scene;
	this.currentScene;
	
	this.loop = true;
	
	this.num = 0;
	this.back = 0;
	this.av = 0;
	
	this.av_i = 0;
	this.back_i = 0;
	
	this.av_h = 0;
	this.count = 0;
	this.countP = 0;
	this.countH = 0;
	this.close = false;
	this.audio = true;
	this.pause = false;
	
	this.dialogo1 = false;
	this.dialogo2 = false;
	this.dialogo3 = false;
	
	this.av_c = 0;
	this.av_carta = 0;
	this.av_g = 0;
	
	this.setup = function()
	{
		this.scene = new Opening();
		this.currentScene = "opening";
	}
	
	this.Opening = function()
	{
		this.scene = new Opening();
		this.currentScene = "opening";
	}
	
	this.Credits = function()
	{
		this.scene = new Credits();
		this.currentScene = "credits";
	}
	
	this.History = function()
	{
		this.scene = new History();
		this.currentScene = "history";
	}
	
	this.Intro = function()
	{
		this.scene = new Intro();
		this.currentScene = "intro";
	}
	
	this.Game = function()
	{
		this.scene = new Game();
		this.currentScene = "game";
	}
	
	this.GameOver = function()
	{
		this.scene = new GameOver();
		this.currentScene = "gameOver";
	}
	
	this.Congratulation = function()
	{
		this.scene = new Congratulation();
		this.currentScene = "congratulation";
	}
	
	this.Carta = function()
	{
		this.scene = new Carta();
		this.currentScene = "carta";
	}
	
	this.Instructions = function()
	{
		this.scene = new Instructions();
		this.currentScene = "instructions";
	}
	
	this.update = function()
	{
		this.scene.update();
	}
	
	this.draw = function()
	{
		this.scene.draw();
	}
}

var sceneManager = new SceneManager();

sceneManager.setup();